package com.matt.order.controller;

import com.matt.order.dto.PlayWithDto;
import com.matt.order.service.PlayWithEnterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/playWithList")
public class PlayWithListController {
    @Autowired
    PlayWithEnterService playWithEnterService;

    @RequestMapping("/init")
    public String playWithListInit(Model model) {
        List<PlayWithDto> playWithDtoList = playWithEnterService.playWithInfoList();
        List<PlayWithDto> playGenderSUMInfoList = playWithEnterService.playGenderSUMInfoList();
        List<PlayWithDto> playLevelSUMInfoList = playWithEnterService.playLevelSUMInfoList();
        String playRollCallSUMInfo = playWithEnterService.playRollCallSUMInfo();
        String playEvaluateSUMInfo = playWithEnterService.playEvaluateSUMInfo();
        List<PlayWithDto> playSourceSUMInfoList = playWithEnterService.playSourceSUMInfoList();
        model.addAttribute("playWithDtoList", playWithDtoList);
        model.addAttribute("playGenderSUMInfoList", playGenderSUMInfoList);
        model.addAttribute("playLevelSUMInfoList", playLevelSUMInfoList);
        model.addAttribute("playRollCallSUMInfo", playRollCallSUMInfo);
        model.addAttribute("playEvaluateSUMInfo", playEvaluateSUMInfo);
        model.addAttribute("playSourceSUMInfoList", playSourceSUMInfoList);
        return "order/playWith-list";
    }
}
